import Vue from 'vue'
import Router from 'vue-router'
import Layout from '@/views/Layout/index'
/* Router Modules */
import componentsRouter from './modules/components'
import orthersRouter from './modules/orthers'
Vue.use(Router)
export const constantRouterMap = [
  {
    path: '/redirect',
    component: Layout,
    hidden: true,
    children: [
      {
        path: '/redirect/:path*',
        component: () => import('@/views/redirect/index')
      }
    ]
  },
  {
    path: '/login',
    component: () => import('@/views/login/index'),
    hidden: true
  },
  componentsRouter,
  orthersRouter
  // {
  //   path: '/',
  //   component: Layout,
  //   hidden: true,
  //   children: [
  //     {
  //       path: '/system/auth',
  //       name: 'Menu',
  //       component: () => import('@/views/system/auth'),
  //       meta: { title: '权限菜单', icon: 'documentation', noCache: true }
  //     },
  //     {
  //       path: '/system/moudle',
  //       name: 'Menu',
  //       component: () => import('@/views/system/moudle'),
  //       meta: { title: '权限按钮', icon: 'documentation', noCache: true }
  //     }
  //   ]
  // }

]
export default new Router({
  // mode: 'history', // require service support
  scrollBehavior: () => ({ y: 0 }),
  routes: constantRouterMap
})

export const asyncRouterMap = [

]
